import request from '@/utils/request'

export function getOrderList(params) {
  return request({
    url: '/merchant/api/v1/order',
    method: 'get',
    params
  })
}
export function getOrderDetails(id) {
  return request({
    url: `/merchant/api/v1/order/query/${id}`,
    method: 'get'
  })
}
// 出票
export function addTicket(data) {
  return request({
    url: '/merchant/api/v1/order',
    method: 'post',
    headers: {
      'Content-Type': 'application/json'
    },
    data
  })
}
// 订单轮训
export function getRotation(uid) {
  return request({
    url: `/merchant/api/v1/order/rotation/${uid}`,
    method: 'get'
  })
}
// 退款&调度预检查
export function getRefund(uid) {
  return request({
    url: `/merchant/api/v1/policy/refund/${uid}`,
    method: 'get',
    headers: {
      'Content-Type': 'application/json'
    }
  })
}
// 退款
export function getOrderRefund(uid) {
  return request({
    url: `/merchant/api/v1/refund/ticket/order/${uid}`,
    method: 'post',
    headers: {
      'Content-Type': 'application/json'
    }
  })
}
// 改签&调度预检查
export function getReschedule(data) {
  return request({
    url: '/merchant/api/v1/policy/reschedule/ticket',
    method: 'post',
    data
  })
}
// 改签
export function updataTicketDate(data) {
  return request({
    url: '/merchant/api/v1/reschedule/ticket/date',
    method: 'post',
    data
  })
}

